home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / Tools / freeWAIS-sf-1.1 / ui / source.h < prev    next >
C/C++ Source or Header  |  1994-08-04  |  3KB  |  118 lines

  1. /* WIDE AREA INFORMATION SERVER SOFTWARE:
  2.    No guarantees or restrictions.  See the readme file for the full standard
  3.    disclaimer.
  4.  
  5.    This is part of the user-interface for the WAIS software.  Do with it
  6.    as you please.
  7.  
  8.    jonathan@Think.COM
  9. */
  10.  
  11. /* Copyright (c) CNIDR (see ../COPYRIGHT) */
  12.  
  13. /*
  14.  * $Log: source.h,v $
  15.  * Revision 1.2  1994/08/05  07:18:33  pfeifer
  16.  * Release beta 04
  17.  *
  18.  * Revision 1.1  93/06/23  20:02:38  warnock
  19.  * Initial revision
  20.  * 
  21.  * Revision 1.1  1993/02/16  15:09:27  freewais
  22.  * Initial revision
  23.  *
  24.  * Revision 1.8  92/04/02  14:23:06  jonathan
  25.  * Added more prototypes.
  26.  * 
  27.  * Revision 1.7  92/03/17  14:31:23  jonathan
  28.  * Merged SourceID.h in, prototyped everything.
  29.  * 
  30.  * Revision 1.6  92/03/06  14:51:04  jonathan
  31.  * New and Improved source loading!
  32.  * 
  33.  * Revision 1.5  92/03/01  13:55:10  jonathan
  34.  * fixed boolean to Boolean as X didn't know about it.
  35.  * 
  36.  * Revision 1.4  92/03/01  13:35:44  jonathan
  37.  * Added functions for X interface.
  38.  * 
  39.  */
  40.  
  41. #ifndef _H_SOURCE
  42. #define _H_SOURCE
  43.  
  44. #include <cdialect.h>
  45.  
  46. /* (jp) */
  47. #ifndef EXTERN_SOURCE_ITEMS
  48. #define EXTERN_SOURCE_ITEMS extern
  49. #endif
  50. EXTERN_SOURCE_ITEMS char **Source_items;
  51. #undef EXTERN_SOURCE_ITEMS
  52.  
  53. #ifndef EXTERN_SOURCE_PATH
  54. #define EXTERN_SOURCE_PATH extern
  55. #endif
  56. EXTERN_SOURCE_PATH char *sourcepath;
  57. #undef EXTERN_SOURCE_PATH
  58.  
  59. typedef struct SourceID {
  60.   char *filename;
  61. } _SourceID, *SourceID;
  62.  
  63. typedef struct source{
  64.   char *name;
  65.   char *directory;
  66.   char server[STRINGSIZE];
  67.   char service[STRINGSIZE];
  68.   char database[STRINGSIZE];
  69.   char cost[STRINGSIZE];
  70.   char units[STRINGSIZE];
  71.   char *description;
  72.   FILE *connection;
  73.   long buffer_length;
  74.   Boolean initp;
  75.   char *maintainer;
  76. } _Source, *Source;
  77.  
  78. typedef struct sourcelist {
  79.   SourceID thisSource;
  80.   struct sourcelist *nextSource;
  81. } _SourceList, *SourceList;
  82.  
  83. typedef struct slist {
  84.   Source thisSource;
  85.   struct slist *nextSource;
  86. } _SList, *SList;
  87.  
  88. /* functions */
  89.  
  90. void freeSourceID _AP((SourceID sid));
  91. SourceID copysourceID _AP((SourceID sid));
  92. char** buildSourceItemList _AP((SourceList sourcelist));
  93. char** buildSItemList _AP((SList sourcelist));
  94. short ReadSourceID _AP((FILE* file, SourceID sid));
  95. SourceList ReadListOfSources _AP((FILE* fp));
  96. Boolean ReadSource _AP((Source source, FILE* file));
  97. Boolean ReadSourceFile _AP((Source asource, char* filename, char* directory));
  98. Source loadSource _AP((char* name, char *path));
  99. void set_connection _AP((Source source));
  100. Boolean newSourcep _AP((char* name));
  101. Boolean is_source _AP((char* name, Boolean test));
  102. void SortSourceNames _AP((int n));
  103. void GetSourceNames _AP((char* directory));
  104. void ReadSourceDirectory _AP((char* directory, Boolean test));
  105. void WriteSource _AP((char* directory, Source source, Boolean overwrite));
  106. SourceList makeSourceList _AP((SourceID source, SourceList rest));
  107. SList makeSList _AP((Source source, SList rest));
  108. void FreeSource _AP((Source source));
  109. void FreeSources _AP((SList sources));
  110. Source findsource _AP((char* name, char *path));
  111. Source findSource _AP((int n));
  112. void format_source_cost _AP((char* str, Source source));
  113. void freeSource _AP((SourceID sourceID));
  114. void freeSourceList _AP((SourceList slist));
  115. Boolean init_for_source _AP((Source source, char* request,
  116.                  long length, char* response));
  117. #endif
  118.